//member management

function AppWindow2(title) {
	var self = Ti.UI.createWindow({
		title:title,
		id:'w'
	});
	
	var button = Ti.UI.createButton({
		id:'b',
		title:L('openWindow'),
	});
	self.add(button);
	
	button.addEventListener('click', function() {
		//containingTab attribute must be set by parent tab group on
		//the window for this work
		self.containingTab.open(Ti.UI.createWindow({
			title: L('newWindow'),
			backgroundColor: 'white'
		}));
	});
	
	// HTML を直に指定
	var lat = "35.697456";
	var log = "139.702148";
	var f = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, 'html/map.html');
	var text = f.read().toString();
	text.replace("LAT",lat);
	text.replace("LOG",log);
	Ti.API.info(text);
	var webView2 = Titanium.UI.createWebView( {
    	html: text,    
	});
	
	self.add(webView2);
	
	return self;
};

module.exports = AppWindow2;
